import { createStore, combineReducers, applyMiddleware, compose } from "redux";
import thunk from 'redux-thunk'
import logger from 'redux-logger'

import Home from "@/container/Home/store";
import List from "@/container/Home/store";

const reducer = combineReducers({
  Home,
  List
});

//开发环境对谷歌插件react-devtool的支持
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

const store =
  process.env.NODE_ENV === "production"
    ? createStore(reducer, applyMiddleware(thunk,logger))
    : createStore(reducer, composeEnhancers(applyMiddleware(thunk, logger)));

export default store
